home *** CD-ROM | disk | FTP | other *** search
- Path: wizard.qualcomm.com!fmerrow
- From: fmerrow@wizard.qualcomm.com (Frank Merrow)
- Newsgroups: comp.lang.c++
- Subject: I presume this is a SIMPLE iostream question
- Date: 5 Mar 1996 23:23:23 GMT
- Organization: Qualcomm Inc.
- Distribution: na
- Message-ID: <4hiidb$qbj@qualcomm.com>
- NNTP-Posting-Host: wizard.qualcomm.com
-
-
- Hi,
-
- Using EMX under OS/2 I lifted the following program out of Stroustrup
- with only minor changes:
-
- #include <iostream.h>
- main()
- {
- char chr;
- while(cin.get(chr))
- {
- cout << chr;
- }
- }
-
- It runs, but there are a number of problems:
-
- 1. The size of the output file does not match the size of the input file.
- In "C" I would add a binary flag, but nothing I can find in iostream.h
- seems to be the equivalent.
-
- 2. It is SLOOOOOOOWWWWWW. Not just slow, VERY SLOW!
-
- a. I assume that perhaps stdin/stdout are tied(). How do I break this
- "standard" connection if in fact it exists.
-
- b. I would prefer some kind of a "block read". What routines should I
- look at. Note that I have NO IDEA what the input looks like. It might
- be "text", but also might be binary "junk" and so the routines should
- be able to handle both without loosing stuff etc.
-
- Pointers to Web Pages with this information and/or sources that I could
- have used to solve this on my own greatly appreciated.
-
- Frank
-